<%--
  Created by IntelliJ IDEA.
  User: 张洪瑞
  Date: 2021-6-15  0015
  Time: 下午 13:29:30
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <!--pageContext.request.contextPath:获取项目的路径 -->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/layui/css/layui.css">
    <!-- 引入 layui.js -->
    <script src="${pageContext.request.contextPath}/layui/layui.js"></script>
</head>
<body>
    <table class="layui-hide" id="test"></table>

</body>
<script>
    layui.use('table', function(){
        var table = layui.table;

        table.render({
            elem: '#test'
            ,url:'/demo/table/user/'
            ,cellMinWidth: 80 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
            ,cols: [[
                ,{field:'username', width:'200px', title: '用户名'}
            ]]
        });
    });
</script>
</html>
